home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 December / PCWDEC07.iso / Software / Freeware / FlashGot 0.6.4 / chrome / flashgot.jar / content / flashgot / filepickerOverlay.js < prev    next >
Encoding:
Text File  |  2007-08-29  |  1.5 KB  |  39 lines

  1. /***** BEGIN LICENSE BLOCK *****
  2.     FlashGot - a Firefox extension for external download managers integration
  3.     Copyright (C) 2004-2006 Giorgio Maone - g.maone@informaction.com
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  
  19. ***** END LICENSE BLOCK *****/
  20. window.addEventListener("load",filePickerDirtyPatch,false);
  21.  
  22. function filePickerDirtyPatch() {
  23.   if(window.title && window.title.indexOf("FlashGot")==0
  24.     && typeof(window.gotoDirectory)=="function") {
  25.     window.fpdp_gotoDirectory=window.gotoDirectory;
  26.     window.gotoDirectory=function(d) {
  27.       window.fpdp_gotoDirectory(d);
  28.       if( filePickerMode == nsIFilePicker.modeGetFolder
  29.           && textInput && (!textInput.value) 
  30.           && d && d.path
  31.          ) {
  32.          textInput.value="."+(d.path.indexOf("\\")>-1?"\\":"/");
  33.          textInput.select();
  34.          textInput.focus();
  35.       }
  36.     }
  37.   }
  38. }
  39.